<?php
$hide_plus_mail=$_GET['hide_plus_mail'];
$hide_plus_mail_forward=$_GET['hide_plus_mail_forward'];
$relay_arr=array();
$relay_arr2=array();

$file_handle = fopen("/etc/passwd", "r");
while (!feof($file_handle)) {
	$line = fgets($file_handle);
	$info = explode(':',$line);
	if($info[0]!=""  && (int)$info[2] > 499){
		$relay_arr[]=$info[0];
	}
}
fclose($file_handle);

$file_handle2 = fopen("/etc/postfix/relay_recipients", "r");
while (!feof($file_handle2)) {
        $line2 = fgets($file_handle2);
        $info2 = explode(' ',$line2);
	if($info2[0]!=""){
		$relay_arr2[]=$info2[0];
	}
}
fclose($file_handle2);

$str=explode('@',$hide_plus_mail);

if(in_array($str[0],$relay_arr)){
	if(in_array($hide_plus_mail,$relay_arr2)){
		echo "1";
	}else{
		echo "0";
	}
}
?>
